﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveCamera : MonoBehaviour
{
    public float speed = 1;
    public float mouseSpeed = 60;
    
    private void Update()
    {
        float h = Input.GetAxis("Horizontal");
        float v = Input.GetAxis("Vertical");
        float mouse = Input.GetAxis("Mouse ScrollWheel"); //滚轮决定z轴，即相机前后移动
        transform.Translate(new Vector3(h * speed, v * speed, mouse * mouseSpeed) * Time.deltaTime, Space.Self);
        //让相机按照自身坐标系移动
    }
}
